package com.dingdang.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000118651780";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDbdy+6Wsx1pV84WlrlDtLWWNKd52Zt+xQXwJRhxxJDIeRcFmAqkAyL9d+yLIQaHTzWLRCbsQLlkangq41mBQxDidePMIY9OxPMYrvbPsi0eyjrLYQjwqK33gPhTFeV1dGZTeeyhe/m3esWSEmUyXc9OW4zD58p+A1HUyCMvzNhSh9srJ/G7mDlbqTjNcCMHzQnO7yYxL4dFJZILTxMNA/9RA8GzNlrcMd6qtSHlrVP62yqKf9qmP0MEO3W64eJLMmBMJP1ya8OW3fTyUp97UVZW2gwRB29KrK4/RFIWNfEfbeFZoWpfsUy31aEEmdyFvQzJ4oR48EB09291rdP4CtLAgMBAAECggEAJ4ZonxxZNFrrMj/7nMM1r4rhq7SQGwCcFscFMjLjFBoXgYo6GZBF4jMO7Yzc4cMgQMZu9ktD5Up9mMvstFH2and5zf0EQCTSpP2nLY46IV8I+IoDAVm9anXepwXTxFV04TJJpzo+AYs4GpQ8REKgafNc6G9I0AsvgQf0lcSdoUidvgLuHz6S06Pi+YcR/rD0b/oYISmU06oXQG3OXRyLsPgjE1lUYZvOmpzprqaCJlM725cWfLgPTZ5CXJOkgcckvUWuALPvdURQc//MAxg0ZkJ0Dm9aFhmep1ySZTEvxgojfnVP+Jwg8JFy6xZjHcF7eJI07Ttu0IyVFGbA4kHgsQKBgQD2HXJM+uj2ju0e7Twg0xWHKxbJ/HVP0zQhrmHTrrWrQrV/yIZaCLP6HhCIVIGkExCTqYB508+3Glg9mx92tnv1SD1IdwbkDp20f7lFH34UBfvblpTsRUltwILpGfEYCBPMbF9YclW9oDx3FrxZcIim9ofno9PQPN0v9g0HEo4fcwKBgQDkR7r7aBU/QhSsKygSP33R1jKyS8MZwni9E1GrqK/6zue+0buawlGQr/cv3GhFr7Eijh8kS2dYWASlJ2Mm+v9KP0ZLVcTvzTAuQBTK2m2OJXAzJ9l57DpwnC8S0oQvPH3W3svTOlMjc0PRur0u8v1Cf9iUfu3HV9BcmOuw9H4eyQKBgQC0aj2h5MTmCTwV0b6kKVi8r3+TLfgpPiAXGKgp7wbJtqsqMysZ0QtuLJ/d8GTgjAE43aaKqBS6mxtYfeCAu6D+26fg+TAZ+gTtjjuYSk+4CfLos+gTk28Sf273xcaQ4UryLfdu9NGZol7wxb/oqK/kBRD3Y4cgPZ2/TNWb+6QntQKBgB8SBEkjqYCqpdWpKhMRwTZGSTArT6q55WUWtA8BLrKcZr56HWa6/A8NZD+HaEnT1/A0F9kAylgj4r331m7/yq94XUDzs5JQAzbIUgwqHq8yOUs9KUSG+o1JNL8DGCq1uQr92BAv6BDzJ0/scsNpHz9l1zye6g4vzZRM3AeBv4jBAoGBAPYMui3QJlYioE+o9DG17Q/b90GdUIQ+omZahdtUaOhwasSjAvbRZQaLr8G1Jh8niu7leo9T9kq82Xheu7dugw/7mUxhz9OLHP8sgbG6Fq7qbweNp5ii8FmTJm0c8gE+NUH04ObR3MQs2KElvFtzgr1pLqwpqn+HWFIdZM9sxx0T";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoUwommdXdjz2K7KOls6MS+9ZpUP4D+eIDINBHZGmXSTyYfzx5TNB91csovIUkXXd64D5p/CFu3T5zvtE0FV9wbNlO7WbzW4jUGExvHWXi0tTwZvrbGtz9U02mqHJO7cBPEcD65xg0LVWmjM76pLtrIBZSNK2iOdvx732jwJSBoo0om+1i6L4+ZXPOE6ZG2tBCFgI5DpL8U0zpzFxKiK4cTApLylI3TTBo9OjUnKqTNMPvJ9iXAMMDgSUETxldP9W1dICt7vutchEoqNMiw7y6Bh3AO5NJiH+7CKAmQi91DLY+9T/r7XHCgf5/UfR3UlCqo8wB6TGb6/mnoCwZ8ZS6QIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://4565v87s25.zicp.vip:39656/reserve/api/reserve/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://4565v87s25.zicp.vip:39656/reserve/api/reserve/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "E:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
